﻿using System.Collections;
using System.Collections.Generic;

namespace Storm.TextEditor.Parser.Objects
{
    public class PatternComparer : IComparer<Pattern>
    {
        #region IComparer Members

        /// <summary>
        /// Compares the specified objects.
        /// </summary>
        /// <param name="firstObject">The first object.</param>
        /// <param name="secondObject">The second object.</param>
        /// <returns>The compared length.</returns>
        public int Compare(Pattern firstObject, Pattern secondObject)
        {
            return secondObject.StringPattern.Length.CompareTo(firstObject.StringPattern.Length);
        }

        #endregion
    }
}
